<!DOCTYPE html>
<html>

<head>
    <title>Flat Admin V.2 - Free Bootstrap Admin Templates</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <#scripts />
</head>

<body class="flat-blue login-page" >
    <div class="container" id="login">
        <div class="login-box">
            <div>
                <div class="login-form row">
                    <div class="col-sm-12 text-center login-header">
                        <i class="login-logo fa fa-connectdevelop fa-5x"></i>
                        <h4 class="login-title">Flat Admin V2</h4>
                    </div>
                    <div class="col-sm-12">
                        <div class="login-body">
                            <div class="progress hidden" id="login-progress">
                                <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
                                    Log In...
                                </div>
                            </div>
                            <form action="/login" method="post">
                                <div class="control">
                                    <input id="username" type="text" class="form-control" name="username" v-model="username" placeholder="请输入用户名" />
                                </div>
                                <div class="control">
                                    <input id="passwords" type="password" class="form-control" name="password" v-model="password" placeholder="请输入密码" />
                                </div>
                                <div class="control">
                                	<div class="checkbox3 checkbox-round checkbox-check checkbox-light">
                                      <input type="checkbox" id="remember-me" name="remember-me" >
                                      <label for="remember-me" style="font-size: 14px;line-height: 14px;">记住我?</label>
                                    </div>
                                </div>
                                <div class="login-button text-center">
                                    <input type="button" class="btn btn-primary" @click="login()" value="登录">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Javascript Libs -->
    <script>
	    var vm = new Vue({
	        el: '#login',
	        data: {
	        	username:"",
	        	password:"",
	        	errorMsg:"${errorMsg!''}"
	        },
	        methods: {
	        	onload:function(){
	        		var errorMsg = vm.errorMsg;
	        		if(errorMsg!=null&&errorMsg!=""){
	        			layer.msg($.trim(errorMsg));
	        		}
	        	},
	       		login:function(){
					if(vm.username==null||vm.username==""){
						layer.msg("请填写用户名");
						return false;
					}else if(vm.password==null||vm.password==""){
						layer.msg("请填写密码");
						return false;
					}else{
						$("form").submit();
					}
	       		}
	        }
	    });
	    vm.onload();
    </script>
</body>

</html>
